-- Prefan Access Controller
-- Command Searcher

if not SERVER then return end

function PAC.SearchCommands( ply, command )

	local data = {}

	for k,v in pairs( PAC.Commands ) do
	
		local lowerfind = string.lower( v.Look )
		local lowercom = string.lower( command )
	
		if string.find( lowerfind, command ) then
		
			table.insert( data, v )
			
		end
		
	end
	
	PAC.Print( PAC_CONSOLE, "Found Commands -------------- " )
	
	for k,v in pairs( data ) do
	
		PAC.Print( PAC_CHAT, ply, Color( 50, 200, 50 ), "Command " .. v.Look, Color( 255, 255, 0 ), " Arguments " .. v.Args )
		
	end
	
end
PAC.AddChatCommand( "search", "STRING", "guest", PAC.SearchCommands )

PAC.AddPlugin( "Command Searcher", "Searches through the command database!", "Prefanatic" )
